package com.example.administrator.nl.activity.order;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.nl.R;
import com.example.administrator.nl.adapter.MyCollectionAdapter;
import com.example.administrator.nl.base.BaseActivity;
import com.example.administrator.nl.bean.MyCollectionBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

// 我的收藏
public class MyCollectionActivity extends BaseActivity {
    @BindView(R.id.recycler_view)
    RecyclerView recyclerView;

    @BindView(R.id.tv_title)
    TextView tv_title;

    @BindView(R.id.iv_finish)
    ImageView iv_finish;

    private MyCollectionAdapter myCollectionAdapter;

    private List<MyCollectionBean> beanList;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
    }

    @Override
    public int getContentView() {
        return R.layout.activity_my_collection;
    }

    @Override
    public void init() {
        getData();
        tv_title.setText("我的收藏");
        recyclerView.setLayoutManager(new LinearLayoutManager(this));
        myCollectionAdapter = new MyCollectionAdapter(R.layout.item_my_mollection_recycle, beanList);
        recyclerView.setAdapter(myCollectionAdapter);

        listener();
    }


    private void listener() {
        iv_finish.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }


    public void getData() {
        beanList = new ArrayList<>();
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
        beanList.add(new MyCollectionBean());
    }


}
